﻿using System;
using System.Collections.Generic;
using Novice.Units;

namespace Novice.Calories
{
    public struct NutritionFacts
    {
        public double Proteins { get; set; }
        public double Fats { get; set; }
        public double Carbohydrates { get; set; }
        public double Calories { get; set; }

        public static NutritionFacts operator +(NutritionFacts left, NutritionFacts right)
        {
            return new NutritionFacts
                   {
                       Proteins = left.Proteins + right.Proteins,
                       Fats = left.Fats + right.Fats,
                       Carbohydrates = left.Carbohydrates + right.Carbohydrates,
                       Calories = left.Calories + right.Calories
                   };
        }

        public static NutritionFacts operator *(NutritionFacts facts, double factor)
        {
            return new NutritionFacts
                   {
                       Proteins = facts.Proteins * factor,
                       Fats = facts.Fats * factor,
                       Carbohydrates = facts.Carbohydrates * factor,
                       Calories = facts.Calories * factor
                   };
        }
    }
}
